﻿/*
 * XCoder v3.4.2011.0316
 * 作者：nnhy/X
 * 时间：2011-04-04 11:54:06
 * 版权：版权所有 (C) 新生命开发团队 2010
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using XCode;
using XCode.DataAccessLayer;

namespace NXCMS.CMS
{
	/// <summary>
	/// 自定义表列
	/// </summary>
	[Serializable]
	[DataObject]
	[Description("自定义表列")]
	[BindTable("CustomTableColumn", Description = "自定义表列", ConnName = "CMS", DbType = DatabaseType.SqlServer)]
	public partial class CustomTableColumn
	{
		#region 属性
		private Int32 _ID;
		/// <summary>
		/// 编号
		/// </summary>
		[Description("编号")]
		[DataObjectField(true, true, false, 10)]
		[BindColumn(1, "ID", "编号", "", "int", 10, 0, false)]
		public Int32 ID
		{
			get { return _ID; }
			set { if (OnPropertyChange("ID", value)) _ID = value; }
		}

		private Int32 _TableID;
		/// <summary>
		/// 表编号
		/// </summary>
		[Description("表编号")]
		[DataObjectField(false, false, true, 10)]
		[BindColumn(2, "TableID", "表编号", "", "int", 10, 0, false)]
		public Int32 TableID
		{
			get { return _TableID; }
			set { if (OnPropertyChange("TableID", value)) _TableID = value; }
		}

		private String _Code;
		/// <summary>
		/// 代码
		/// </summary>
		[Description("代码")]
		[DataObjectField(false, false, false, 50)]
		[BindColumn(3, "Code", "代码", "", "nvarchar(50)", 0, 0, true)]
		public String Code
		{
			get { return _Code; }
			set { if (OnPropertyChange("Code", value)) _Code = value; }
		}

		private String _Name;
		/// <summary>
		/// 名称
		/// </summary>
		[Description("名称")]
		[DataObjectField(false, false, false, 100)]
		[BindColumn(4, "Name", "名称", "", "nvarchar(100)", 0, 0, true)]
		public String Name
		{
			get { return _Name; }
			set { if (OnPropertyChange("Name", value)) _Name = value; }
		}

		private String _DataType;
		/// <summary>
		/// 数据类型
		/// </summary>
		[Description("数据类型")]
		[DataObjectField(false, false, false, 50)]
		[BindColumn(5, "DataType", "数据类型", "", "nvarchar(50)", 0, 0, true)]
		public String DataType
		{
			get { return _DataType; }
			set { if (OnPropertyChange("DataType", value)) _DataType = value; }
		}

		private Int32 _Length;
		/// <summary>
		/// 长度
		/// </summary>
		[Description("长度")]
		[DataObjectField(false, false, true, 10)]
		[BindColumn(6, "Length", "长度", "", "int", 10, 0, false)]
		public Int32 Length
		{
			get { return _Length; }
			set { if (OnPropertyChange("Length", value)) _Length = value; }
		}

		private Boolean _isPrimaryKey;
		/// <summary>
		/// 是否主键
		/// </summary>
		[Description("是否主键")]
		[DataObjectField(false, false, true, 1)]
		[BindColumn(7, "isPrimaryKey", "是否主键", "", "bit", 0, 0, false)]
		public Boolean isPrimaryKey
		{
			get { return _isPrimaryKey; }
			set { if (OnPropertyChange("isPrimaryKey", value)) _isPrimaryKey = value; }
		}

		private Boolean _isMandatory;
		/// <summary>
		/// 是否男人
		/// </summary>
		[Description("是否男人")]
		[DataObjectField(false, false, false, 1)]
		[BindColumn(8, "isMandatory", "是否男人", "", "bit", 0, 0, false)]
		public Boolean isMandatory
		{
			get { return _isMandatory; }
			set { if (OnPropertyChange("isMandatory", value)) _isMandatory = value; }
		}

		private String _DefaultValue;
		/// <summary>
		/// 默认值
		/// </summary>
		[Description("默认值")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(9, "DefaultValue", "默认值", "", "nvarchar(50)", 0, 0, true)]
		public String DefaultValue
		{
			get { return _DefaultValue; }
			set { if (OnPropertyChange("DefaultValue", value)) _DefaultValue = value; }
		}

		private Boolean _InputType;
		/// <summary>
		/// 输入类型
		/// </summary>
		[Description("输入类型")]
		[DataObjectField(false, false, true, 1)]
		[BindColumn(10, "InputType", "输入类型", "", "bit", 0, 0, false)]
		public Boolean InputType
		{
			get { return _InputType; }
			set { if (OnPropertyChange("InputType", value)) _InputType = value; }
		}

		private String _CSSStyle;
		/// <summary>
		/// CSS样式
		/// </summary>
		[Description("CSS样式")]
		[DataObjectField(false, false, true, 200)]
		[BindColumn(11, "CSSStyle", "CSS样式", "", "nvarchar(200)", 0, 0, true)]
		public String CSSStyle
		{
			get { return _CSSStyle; }
			set { if (OnPropertyChange("CSSStyle", value)) _CSSStyle = value; }
		}

		private Int32 _MaxLength;
		/// <summary>
		/// 最大长度
		/// </summary>
		[Description("最大长度")]
		[DataObjectField(false, false, true, 10)]
		[BindColumn(12, "MaxLength", "最大长度", "", "int", 10, 0, false)]
		public Int32 MaxLength
		{
			get { return _MaxLength; }
			set { if (OnPropertyChange("MaxLength", value)) _MaxLength = value; }
		}

		private String _ListOptions;
		/// <summary>
		/// 列表选项
		/// </summary>
		[Description("列表选项")]
		[DataObjectField(false, false, true, 1073741823)]
		[BindColumn(13, "ListOptions", "列表选项", "", "ntext", 0, 0, true)]
		public String ListOptions
		{
			get { return _ListOptions; }
			set { if (OnPropertyChange("ListOptions", value)) _ListOptions = value; }
		}

		private Boolean _isAutoID;
		/// <summary>
		/// 是否自动编号
		/// </summary>
		[Description("是否自动编号")]
		[DataObjectField(false, false, true, 1)]
		[BindColumn(14, "isAutoID", "是否自动编号", "", "bit", 0, 0, false)]
		public Boolean isAutoID
		{
			get { return _isAutoID; }
			set { if (OnPropertyChange("isAutoID", value)) _isAutoID = value; }
		}

		private String _Prop1;
		/// <summary>
		/// 属性1
		/// </summary>
		[Description("属性1")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(15, "Prop1", "属性1", "", "nvarchar(50)", 0, 0, true)]
		public String Prop1
		{
			get { return _Prop1; }
			set { if (OnPropertyChange("Prop1", value)) _Prop1 = value; }
		}

		private String _Prop2;
		/// <summary>
		/// 属性2
		/// </summary>
		[Description("属性2")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(16, "Prop2", "属性2", "", "nvarchar(50)", 0, 0, true)]
		public String Prop2
		{
			get { return _Prop2; }
			set { if (OnPropertyChange("Prop2", value)) _Prop2 = value; }
		}

		private String _AddUser;
		/// <summary>
		/// 添加用户
		/// </summary>
		[Description("添加用户")]
		[DataObjectField(false, false, false, 200)]
		[BindColumn(17, "AddUser", "添加用户", "", "nvarchar(200)", 0, 0, true)]
		public String AddUser
		{
			get { return _AddUser; }
			set { if (OnPropertyChange("AddUser", value)) _AddUser = value; }
		}

		private DateTime _AddTime;
		/// <summary>
		/// 添加时间
		/// </summary>
		[Description("添加时间")]
		[DataObjectField(false, false, false, 7)]
		[BindColumn(18, "AddTime", "添加时间", "", "datetime2", 7, 0, false)]
		public DateTime AddTime
		{
			get { return _AddTime; }
			set { if (OnPropertyChange("AddTime", value)) _AddTime = value; }
		}

		private String _ModifyUser;
		/// <summary>
		/// 修改用户
		/// </summary>
		[Description("修改用户")]
		[DataObjectField(false, false, true, 200)]
		[BindColumn(19, "ModifyUser", "修改用户", "", "nvarchar(200)", 0, 0, true)]
		public String ModifyUser
		{
			get { return _ModifyUser; }
			set { if (OnPropertyChange("ModifyUser", value)) _ModifyUser = value; }
		}

		private DateTime _ModifyTime;
		/// <summary>
		/// 修改时间
		/// </summary>
		[Description("修改时间")]
		[DataObjectField(false, false, true, 7)]
		[BindColumn(20, "ModifyTime", "修改时间", "", "datetime2", 7, 0, false)]
		public DateTime ModifyTime
		{
			get { return _ModifyTime; }
			set { if (OnPropertyChange("ModifyTime", value)) _ModifyTime = value; }
		}

		private String _BackupNo;
		/// <summary>
		/// 备份编号
		/// </summary>
		[Description("备份编号")]
		[DataObjectField(false, false, true, 15)]
		[BindColumn(21, "BackupNo", "备份编号", "", "nvarchar(15)", 0, 0, true)]
		public String BackupNo
		{
			get { return _BackupNo; }
			set { if (OnPropertyChange("BackupNo", value)) _BackupNo = value; }
		}

		private String _BackupOperator;
		/// <summary>
		/// 备份操作者
		/// </summary>
		[Description("备份操作者")]
		[DataObjectField(false, false, true, 200)]
		[BindColumn(22, "BackupOperator", "备份操作者", "", "nvarchar(200)", 0, 0, true)]
		public String BackupOperator
		{
			get { return _BackupOperator; }
			set { if (OnPropertyChange("BackupOperator", value)) _BackupOperator = value; }
		}

		private DateTime _BackupTime;
		/// <summary>
		/// 备份时间
		/// </summary>
		[Description("备份时间")]
		[DataObjectField(false, false, true, 7)]
		[BindColumn(23, "BackupTime", "备份时间", "", "datetime2", 7, 0, false)]
		public DateTime BackupTime
		{
			get { return _BackupTime; }
			set { if (OnPropertyChange("BackupTime", value)) _BackupTime = value; }
		}

		private String _BackupMemo;
		/// <summary>
		/// 备份注释
		/// </summary>
		[Description("备份注释")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(24, "BackupMemo", "备份注释", "", "nvarchar(50)", 0, 0, true)]
		public String BackupMemo
		{
			get { return _BackupMemo; }
			set { if (OnPropertyChange("BackupMemo", value)) _BackupMemo = value; }
		}
		#endregion

		#region 获取/设置 字段值
		/// <summary>
		/// 获取/设置 字段值。
		/// 一个索引，基类使用反射实现。
		/// 派生实体类可重写该索引，以避免反射带来的性能损耗
		/// </summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		public override Object this[String name]
		{
			get
			{
				switch (name)
				{
					case "ID" : return _ID;
					case "TableID" : return _TableID;
					case "Code" : return _Code;
					case "Name" : return _Name;
					case "DataType" : return _DataType;
					case "Length" : return _Length;
					case "isPrimaryKey" : return _isPrimaryKey;
					case "isMandatory" : return _isMandatory;
					case "DefaultValue" : return _DefaultValue;
					case "InputType" : return _InputType;
					case "CSSStyle" : return _CSSStyle;
					case "MaxLength" : return _MaxLength;
					case "ListOptions" : return _ListOptions;
					case "isAutoID" : return _isAutoID;
					case "Prop1" : return _Prop1;
					case "Prop2" : return _Prop2;
					case "AddUser" : return _AddUser;
					case "AddTime" : return _AddTime;
					case "ModifyUser" : return _ModifyUser;
					case "ModifyTime" : return _ModifyTime;
					case "BackupNo" : return _BackupNo;
					case "BackupOperator" : return _BackupOperator;
					case "BackupTime" : return _BackupTime;
					case "BackupMemo" : return _BackupMemo;
					default: return base[name];
				}
			}
			set
			{
				switch (name)
				{
					case "ID" : _ID = Convert.ToInt32(value); break;
					case "TableID" : _TableID = Convert.ToInt32(value); break;
					case "Code" : _Code = Convert.ToString(value); break;
					case "Name" : _Name = Convert.ToString(value); break;
					case "DataType" : _DataType = Convert.ToString(value); break;
					case "Length" : _Length = Convert.ToInt32(value); break;
					case "isPrimaryKey" : _isPrimaryKey = Convert.ToBoolean(value); break;
					case "isMandatory" : _isMandatory = Convert.ToBoolean(value); break;
					case "DefaultValue" : _DefaultValue = Convert.ToString(value); break;
					case "InputType" : _InputType = Convert.ToBoolean(value); break;
					case "CSSStyle" : _CSSStyle = Convert.ToString(value); break;
					case "MaxLength" : _MaxLength = Convert.ToInt32(value); break;
					case "ListOptions" : _ListOptions = Convert.ToString(value); break;
					case "isAutoID" : _isAutoID = Convert.ToBoolean(value); break;
					case "Prop1" : _Prop1 = Convert.ToString(value); break;
					case "Prop2" : _Prop2 = Convert.ToString(value); break;
					case "AddUser" : _AddUser = Convert.ToString(value); break;
					case "AddTime" : _AddTime = Convert.ToDateTime(value); break;
					case "ModifyUser" : _ModifyUser = Convert.ToString(value); break;
					case "ModifyTime" : _ModifyTime = Convert.ToDateTime(value); break;
					case "BackupNo" : _BackupNo = Convert.ToString(value); break;
					case "BackupOperator" : _BackupOperator = Convert.ToString(value); break;
					case "BackupTime" : _BackupTime = Convert.ToDateTime(value); break;
					case "BackupMemo" : _BackupMemo = Convert.ToString(value); break;
					default: base[name] = value; break;
				}
			}
		}
		#endregion

		#region 字段名
		/// <summary>
		/// 取得自定义表列字段名的快捷方式
		/// </summary>
		public class _
		{
			///<summary>
			/// 编号
			///</summary>
			public const String ID = "ID";

			///<summary>
			/// 表编号
			///</summary>
			public const String TableID = "TableID";

			///<summary>
			/// 代码
			///</summary>
			public const String Code = "Code";

			///<summary>
			/// 名称
			///</summary>
			public const String Name = "Name";

			///<summary>
			/// 数据类型
			///</summary>
			public const String DataType = "DataType";

			///<summary>
			/// 长度
			///</summary>
			public const String Length = "Length";

			///<summary>
			/// 是否主键
			///</summary>
			public const String isPrimaryKey = "isPrimaryKey";

			///<summary>
			/// 是否男人
			///</summary>
			public const String isMandatory = "isMandatory";

			///<summary>
			/// 默认值
			///</summary>
			public const String DefaultValue = "DefaultValue";

			///<summary>
			/// 输入类型
			///</summary>
			public const String InputType = "InputType";

			///<summary>
			/// CSS样式
			///</summary>
			public const String CSSStyle = "CSSStyle";

			///<summary>
			/// 最大长度
			///</summary>
			public const String MaxLength = "MaxLength";

			///<summary>
			/// 列表选项
			///</summary>
			public const String ListOptions = "ListOptions";

			///<summary>
			/// 是否自动编号
			///</summary>
			public const String isAutoID = "isAutoID";

			///<summary>
			/// 属性1
			///</summary>
			public const String Prop1 = "Prop1";

			///<summary>
			/// 属性2
			///</summary>
			public const String Prop2 = "Prop2";

			///<summary>
			/// 添加用户
			///</summary>
			public const String AddUser = "AddUser";

			///<summary>
			/// 添加时间
			///</summary>
			public const String AddTime = "AddTime";

			///<summary>
			/// 修改用户
			///</summary>
			public const String ModifyUser = "ModifyUser";

			///<summary>
			/// 修改时间
			///</summary>
			public const String ModifyTime = "ModifyTime";

			///<summary>
			/// 备份编号
			///</summary>
			public const String BackupNo = "BackupNo";

			///<summary>
			/// 备份操作者
			///</summary>
			public const String BackupOperator = "BackupOperator";

			///<summary>
			/// 备份时间
			///</summary>
			public const String BackupTime = "BackupTime";

			///<summary>
			/// 备份注释
			///</summary>
			public const String BackupMemo = "BackupMemo";
		}
		#endregion
	}
}